package com.example.params;

import lombok.Data;

/**
 * @Author 刘武贵
 * @Date 2024/2/27 22:49
 * @Description 功能描述：订单参数类
 */
@Data
public class OrderParams {

    /**
     * 商品id
     */
    private Long productId;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 购买的商品数量
     */
    private Integer count;

    /**
     * 判断是否为空
     * @return 如果为空则返回true，否则返回false
     */
    public boolean isEmpty(){
        return (productId == null || productId <= 0) ||
                (userId == null || userId <= 0) ||
                (count == null || count <= 0);
    }
}
